const store = require("./store/优化/index-优化")

//直接订阅数据，不需要每次再手动进行getState
const unsubscribe = store.subscribe(() => {
   console.log("订阅数据的变化:", store.getState());
})

const counterAction = { type: 'add_number', counter: 10}
store.dispatch(counterAction)
store.dispatch(counterAction)

//取消订阅
unsubscribe()

store.dispatch(counterAction)

